home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #14 / Monster Media No. 14 (April 1996) (Monster Media, Inc.).ISO / math / maca_101.zip / ADD.DEM next >
Text File  |  1996-01-30  |  2KB  |  70 lines

  1. ;ADD.DEM
  2. ;DEMO FILE FOR MASSCALC VERSION 1.00
  3. ;WRITTEN BY: Ralph W. Reid
  4. ;This file may only be distributed in its unmodified form.
  5. ;
  6. ;DESCRIPTION:  This file demonstrates the column addition constructs.
  7. ;
  8. ;For the latest releases of MASSCALC and other software created by
  9. ;Ralph W. Reid, see http://www2.athenon.com/~rreid/products/00-index.html.
  10. ;
  11. ;HOW TO USE THIS FILE:  This file may be piped into MASSCALC, and its
  12. ;output displayed as follows:
  13. ;TYPE ADD.DEM | MASSCALC | MORE
  14. ;This file may be redirected into MASSCALC and its output displayed
  15. ;as follows:
  16. ;MASSCALC < ADD.DEM | MORE
  17. ;These two commands should be run from the operating system prompt.
  18.  
  19. ;add a column of numbers and display the result
  20. print: "Adding a simple column of numbers:"
  21. ADD:
  22.   1.50
  23.   3.50
  24.   2.25
  25.   3.75
  26.  -1.00
  27. ENDADD
  28.  
  29. ;add the same numbers into a variable and display the result
  30. ADD INTO: sum
  31.   1.50
  32.   3.50
  33.   2.25
  34.   3.75
  35.  -1.00
  36. ENDADD
  37. print:
  38. print: "Total assigned to 'sum'."
  39. print: "The sum is" sum "."
  40.  
  41. ;perform addition with equations
  42. print:
  43. print: "Adding equations:"
  44. add:
  45.   root_secant (x, 1, 2, x - sqrt(2))
  46.   - sqrt (2)
  47.   sin (_pi_2) / log_b (2, 2^2)
  48.   0.5
  49.   floor (sin (_pi)) * tan (_pi/3) + ceil (cos (_pi_2))
  50.   1 ^ 2e11
  51. endadd
  52.  
  53. ;add moving expenses into a variable and subtract from budget
  54. moving budget = 3500.00;
  55. add into: moving expenses
  56.   1200.00;  truck and trailer rental
  57.   1100.00;  rent and deposits
  58.    350.00;  gas
  59.    180.00;  motel rooms
  60.    150.00;  food and road munchies
  61.    100.00;  utility turn-ons
  62.     30.00;  pet tranquilizers
  63. endadd
  64. print:
  65. print: "ARTIFICIAL MOVE--BUDGET AND EXPENSES"
  66. print: "Budgeted amount for this move is" moving budget "."
  67. print: "Estimated cost for this move is" moving expenses "."
  68. print: "If this total is < 0, do not move-->" moving budget - moving expenses
  69.  
  70.